package app.TianQi;

import qiurank.Log;
import qiurank.UrlManageFather;
import qiurank.UrlManageInterface;
import qiurank.UrlObject;

/**
 * Created by Administrator on 2016/1/14.
 */
public class UrlManage  extends UrlManageFather implements UrlManageInterface {
    private WeatherModel weatherModel;
    private int yes_i=0;
    @Override
    public UrlObject getNoUrl() {
        int len=noUrl.size();
        if(len>0){
            return plan.doPlanGetNoPaUrl(noUrl);
        }else {
            return null;
        }
    }

    @Override
    public boolean setPa(UrlObject urlObject) {
        if(urlObject!=null) {
            if (noUrl.contains(urlObject)) {
                noUrl.remove(urlObject);
                //Log.console("移除:"+urlObject.url);
                yes_i++;
            }
        }
        return false;
    }

    @Override
    public int getYesUrlCount(){
        return yes_i;
    }

    @Override
    protected void setNoUrlList() {
        weatherModel=new WeatherModel();
        noUrl=weatherModel.getWeatherIdList(0,3000);
    }
    public WeatherModel getWeatherModel(){
        return weatherModel;
    }
    @Override
    public boolean addUrl(String url, int weight) {
        return false;
    }
}
